void setup() {
  size(800, 350);
  PFont mono=createFont("abc", 50);
  textFont(mono);
  noLoop();  // draw() will not loop
  //fill(0);
}

int x = 0;



void draw() {
  switch(x){
    case 0:
      rect(550,50,200,270,5);
      fill(0);
      text("企业",595,160);
      text("(法人)",585,230);
      break;
    case 1:
      stroke(46,139,87);
      fill(46,139,87);
      strokeWeight(2);
      textSize(20);
      line(350,80,550,80);
      line(530,70,550,80);
      
      text("投资",400,70);
      fill(0);
      text("所有者",250,95);
      break;
    case 2:
      fill(46,139,87);  
      line(350,180,550,180);
      line(530,170,550,180);
      
      text("借款",400,170);
      fill(0);
      text("债权人",250,195);
      break;
    case 3:
      fill(46,139,87);
      line(350,280,550,280);
      line(530,270,550,280);
      text("补助",400,270);
      fill(0);
      text("政府",265,295);
      break;
    case 4:
      stroke(129,129,129);
      line(220,50,220,300);
      stroke(46,139,87);
      line(50,130,200,130);
      line(190,120,200,130);
      fill(46,139,87);
      text("资金的投入",70,120);
      break;
    case 5:
      stroke(255,0,0);
      fill(255,0,0);
      line(350,85,550,85);
      line(350,85,370,95);
      text("分配利润",400,115);
      break;
    case 6:
      line(350,185,550,185);
      line(350,185,370,195);
      text("还本付息",400,215);
      break;
    case 7:
      line(350,285,550,285);
      line(350,285,370,295);
      text("纳税",400,315);
      break;
    case 8:
      line(50,260,200,260);
      line(50,260,60,270);
      text("资金的退出",70,250);
  }
}

void mousePressed() {
  x++;
  redraw();
}
